import React, { Component } from 'react'
import axios from 'axios'
export default class Son2 extends Component {
    render() {
        return (
            <div>Son2</div>
        )
    }
    controller = new AbortController(); // 请求控制器
    componentDidMount() {
        // 发起数据请求
        axios.get('https://api.i-lynn.cn/college', {
            signal: this.controller.signal
        }).then(res => {
            console.log('son2-res', res);
        }).catch(err => { })

        console.log('son2-componentDidMount');
    }
    componentWillUnmount() {
        // 取消请求
        //this.controller.abort()
        console.log('son2-componentWillUnmount');
    }
}
